<style>
    #yw0:hover{
        cursor: pointer;
    }
    #baigiang-title{
        background-color: #B7D6E7;
        width: 99.2%;
        height: 25px;
        text-align: center;
        vertical-align: central;
        padding-top: 5px;
        border-left: 5px solid #6FACCF;
    }
    #text-title{
        margin-top: 5px;
        color: white;
        font-size: 20px;
        font-weight: bold;
    }
</style>

<?php
/* @var $this SiteController */

$this->pageTitle=Yii::app()->name;
?>
<div class="left-col">
    <div id="baigiang-title">
        <span id="text-title">
            <?php echo $model->name;?>
        </span>
        <span style="float: right; margin-right: 5px;">
            <?php 
                    $img = CHtml::image(Yii::app()->baseUrl.'/images/fullscreen.png','fullscreen',array('style'=>'width:25px'));
                    $this->widget('ext.popup.JPopupWindow', array(
                         'content'=>$img,
                         'url'=>Utils::createAbsoluteUrl($model->linkurl),        
                         'htmlOptions'=>array('title'=>"yahoo.com"),
                         'options'=>array(
                             'height'=>700,
                             'width'=>1200,
                             'top'=>50,
                             'left'=>50,
                         ),
        )); ?>
        </span> 
        
            
    </div>
    <div id="elearning-content">
    <iframe src="<?php echo Utils::createAbsoluteUrl($model->linkurl) ?>" style="width:600px;height: 400px" allowfullscreen = true></iframe>
    </div>
    <div>
        <?php echo $model->description?>
    </div>
</div>

<div class="right-col">
    <?php
        if (!isset(Yii::app()->user->userId) ) {
                $this->beginWidget('zii.widgets.CPortlet', array(
                        'title'=>'Đăng nhập',
                ));
                        $this->renderPartial('_login');
                $this->endWidget();
        }
        
        $this->beginWidget('zii.widgets.CPortlet', array(
                    'title'=>'Tìm kiếm',
            ));
                $this->renderPartial('_search');
        $this->endWidget();
    
        $this->beginWidget('zii.widgets.CPortlet', array(
                'title'=>'Thư mục bài giảng',
        ));
                $this->widget('CTreeView',array(
                            'data'=>$this->getFolderTreeData(),
                            'animated'=>'fast', //quick animation
                            'collapsed'=>'false',//remember must giving quote for boolean value in here
                            'htmlOptions'=>array(
                                    'class'=>'treeview-red',//there are some classes that ready to use
                            ),
                ));
        $this->endWidget();
    ?>
</div>

<div style="clear: both"></div>
<script>
    function show(){
        document.getElementsByTagName('iframe')[0].style.display = 'inline';
        document.getElementById('thumbnail-web').style.display = 'none';
    }
    $(function (){
        $('#yw0').click(function (){
            document.getElementsByTagName('iframe')[0].style.display = 'none';
            if($('#thumbnail-web').length > 0){
                document.getElementById('thumbnail-web').style.display = 'inline';
            }else{
                var img = document.createElement('a');
                img.setAttribute('href','#');
                img.setAttribute('onclick','show()');
                img.setAttribute('id','thumbnail-web');
                img.innerHTML = '<?php echo CHtml::image(Yii::app()->baseUrl.'/images/thumbnail-web.jpg')?>';
                var div = document.getElementById('elearning-content');
                div.appendChild(img);
            }
        });
    })
</script>